package bakery.dao;

import java.sql.SQLException;
import java.util.ArrayList;

import org.springframework.orm.ibatis.SqlMapClientTemplate;

import bakery.vo.MainCategoryVO;



public class MainCategoryDAO {

	private SqlMapClientTemplate client;
	
	public MainCategoryDAO(SqlMapClientTemplate client){
		this.client = client;
	}
	
	public void insertMainCategory(MainCategoryVO mvo) throws SQLException{
		client.insert("insertMainCategory", mvo);
	}
	
	public void deleteMainCategory(String code) throws SQLException{
		client.delete("deleteMainCategoryByCode", code);
	}
	
	public void updateMainCategory(MainCategoryVO mvo) throws SQLException{
		client.update("updateMainCategory", mvo);
	}
	
	public ArrayList<MainCategoryVO> selectMainCategory() throws SQLException{
		return (ArrayList<MainCategoryVO>)client.queryForList("selectMainCategory");
	}
}
